﻿using Furion;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;

namespace Kevin.Dapr.Test
{
    public class Startup : AppStartup
    {

        public void ConfigureServices(IServiceCollection services)
        {
            // 注册远程服务
            services.AddRemoteRequest(options =>
            {
                // 无序授权api
                options.AddHttpClient("api", c =>
                {
                    c.BaseAddress = new Uri("http://www.test.com/api/");
                    //c.DefaultRequestHeaders.Add("Accept", "application/vnd.github.v3+json");
                    //c.DefaultRequestHeaders.Add("User-Agent", "HttpClientFactory-Sample");
                });

                // 配置特定客户端
                options.AddHttpClient("api_auth", c =>
                {
                    c.BaseAddress = new Uri("http://www.test.com/api/");
                    //c.DefaultRequestHeaders.Add("")
                    //c.DefaultRequestHeaders.Add("Accept", "application/vnd.github.v3+json");
                    //c.DefaultRequestHeaders.Add("User-Agent", "HttpClientFactory-Sample");
                });
            });
        }
    }
}
